import {Request} from "./request";

//获取初始进入首页轮播
module.exports.Banner = () => Request({
  url: "/banner/list",
  method: "get"
})
//获取首页轮播
module.exports.BannerList = () => Request({
  url: "/banner/list",
  method: "get"
})
//获取首页9宫格
module.exports.nineList = () => Request({
  url: "/shop/goods/category/all",
  method: "get"
})
//商品
module.exports.shopList = () => Request({
  url: "/shop/goods/list",
  method: "get"
})
//商品详情
module.exports.particulars = (obj) => Request({
  url: "/shop/goods/detail",
  method: "post",
  data:obj
})
// 登录
module.exports.login = (obj) => Request({
  url: "/user/wxapp/login",
  method: "get",
  data:obj
})
// 注册
module.exports.sign = (obj) => Request({
  url: "/user/wxapp/register/complex",
  method: "post",
  data:obj
})
// 购物车获取数据
module.exports.shop=(obj)=>Request({
  url:`/shopping-cart/info`,
  method:'get',
  data:obj
})
// 购物车删除单个商品
module.exports.shRemove=(obj)=>Request({
  url:`/shopping-cart/remove`,
  method:'post',
  data:obj
})
  // 修改数量
module.exports.shNum=(obj)=>Request({
    url:`/shopping-cart/modifyNumber`,
    method:'post',
    data:obj
})
// 收货地址
module.exports.address=(obj)=>Request({
  url:`/user/shipping-address/add`,
  method:'post',
  data:obj
})
// 所有收货地址
// module.exports.suoAddress=(obj)=>Request({
//   url:`/user/shipping-address/delete`,
//   method:'post',
//   data:obj
// })
// 自提门店
module.exports.shDian=()=>Request({
  url:`/shop/subshop/list`,
  method:'post'
})
// 我的订单
module.exports.myOrder = (obj) => Request({
  url: "/order/list",
  method: "get",
  data:obj
})
//分类左侧
module.exports.flOrder=()=>Request({
  url:`/shop/goods/category/all`,
  method:'get',
  
})
// 分类右侧
module.exports.flRight=(data)=>Request({
  url:`/shop/goods/list`,
  method:'post',
  mothod:'post',
})
// 我的订单
module.exports.myOrder = (obj) => Request({
  url: "/order/list",
  method: "get",
  data:obj
})
// 分类右侧
module.exports.flRights=(data)=>Request({
  url:`/shop/goods/list?categoryId=${data}`,
  method:'get',
  data:data
})
//加入购物车
module.exports.addcart=(data)=>Request({
  url:`/shopping-cart/add`,
  method:'post',
  data:data
})
//分类搜索
module.exports.search = () => {
  return Request({
    url: "/shop/goods/list",
    method:'post'
  })
}
// 我的资产数据
module.exports.propertyList = (obj) => Request({
  url: "/user/amount",
  method: "get",
  data:obj

})
// 请求收藏数据
module.exports.getCollection = (obj) => Request({
  url: "/shop/goods/fav/list",
  method: "post",
  data:obj

})
// 删除收藏数据
module.exports.remCollection = (obj) => Request({
  url: "/shop/goods/fav/delete",
  method: "post",
  data:obj

})
// 请求收货地址数据
module.exports.getSite = (obj) => Request({
  url: "/user/shipping-address/list",
  method: "get",
  data:obj

})
// 修改收货地址
module.exports.update=(obj)=>Request({
  url:`/user/shipping-address/update`,
  method:"post",
  data:obj
})
// 删除收货地址
module.exports.del=(obj)=>Request({
  url:`/user/shipping-address/delete`,
  method:'post',
  data:obj
})
//加入购物车
module.exports.joinShop = (obj) => Request({
  url: "/shopping-cart/add",
  method: "post",
  data:obj

})

//检测是否已收藏
module.exports.fav = (obj) => Request({
  url: "/shop/goods/fav/check",
  method: "post",
  data:obj
})
//添加收藏
module.exports.favAdd = (obj) => Request({
  url: "/shop/goods/fav/add",
  method: "post",
  data:obj
})
//添加收藏
module.exports.favDelete = (obj) => Request({
  url: "/shop/goods/fav/delete",
  method: "post",
  data:obj
})


